package com.sgcc.nfc.lock.core.network

import com.google.gson.annotations.SerializedName

data class ApiResponse<T>(
    @SerializedName("code") val code: Int,
    @SerializedName("message") val message: String?,
    @SerializedName("data") val data: T?,
    @SerializedName("timestamp") val timestamp: Long?
) {
    val isSuccess: Boolean get() = code == 0 || code == 200
}

data class PagedResponse<T>(
    @SerializedName("size") val size: Long,
    @SerializedName("records") val records: List<T>,
    @SerializedName("current") val current: Long,
    @SerializedName("total") val total: Long,
    @SerializedName("pages") val pages: Long
)
